'use strict';
function includes(object,ch){
  for(let valueItem in object){
    for(let item of object[valueItem])
      if(item === ch){
        return true;
      }
  }
  return false;
}

module.exports = function collectSameElements(collectionA, objectB) {
  let result = [];
  for(let item of collectionA){
    if(includes(objectB,item)){
      result.push(item);
    }
  }
  return result;
}
